package com.shihb.behavioralpatterns.visitorpattern;/**
 *Description:访问者模式
 *Version:1.0.0
 *@author shihb
 *@date 2020/4/21 11:26
 */
public class Client {

  public static void main(String[] args) {
    Man shb = new Man("shb");
    Woman wyh = new Woman("wyh");
    Man shb2 = new Man("shb2");
    Woman cl = new Woman("cl");
    ObjectStructure successStructure = new ObjectStructure();
    successStructure.addPersion(shb);
    successStructure.addPersion(wyh);
    ObjectStructure failStructure = new ObjectStructure();
    failStructure.addPersion(shb2);
    failStructure.addPersion(cl);
    Action success = new Success();
    Action fail = new Fail();
    System.out.println("==========打成功==========");
    successStructure.showAction(success);
    System.out.println("==========打失败=============");
    failStructure.showAction(fail);
  }
}
